const db = require("../../../db");
const {SYSTEM_ERROR} = require("../../../utils/errorCode");
exports.main =  (req, res) => {
    // const cart = req.session.cart || {};  // 获取购物车信息
    //
    // res.sd(cart);
    const {userId} = req.auth;
    // 获取购物车信息
    const sql = `select * from shopping_carts where userId = ?`;
    db.query(sql,userId, (err, result) => {
        if (err) {
            console.log(err);
            return res.err(SYSTEM_ERROR);
        }

        return res.sd(result[0]);
    })
}

